public class Main {
    public static void main(String[] args) {
        Mementos mementos = new Mementos();
        Car littlecar = new Car(0,0);
        System.out.println("小车停在"+"X:" +  littlecar.getX() +"Y:" + littlecar.getY());
        mementos.setMemento(littlecar.save());
        littlecar.setY(10);
        System.out.println("小车行驶到"+"X:" +  littlecar.getX() +"Y:" + littlecar.getY());
        mementos.setMemento(littlecar.save());
        littlecar.setX(10);
        System.out.println("小车行驶到"+"X:" +  littlecar.getX() +"Y:" + littlecar.getY());
        littlecar.restore(mementos.getMemento());
        System.out.println("小车倒车"+"X:" +  littlecar.getX() +"Y:" + littlecar.getY());

    }



}